<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="ordertech.id">编辑文件信息</span>
                        <span *ngIf="!ordertech.id">创建文件信息</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-6">
                            <label>文件名称
                                <span class="text-danger">*</span>
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="fileName" [ngClass]="{'edited': ordertech.fileName}"
                                    [(ngModel)]="ordertech.fileName">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>型号
                            </label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="modelName" [ngClass]="{'edited': ordertech.modelName}"
                                    [(ngModel)]="ordertech.modelName">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label>文件类型</label>
                            <select #techFileInfoTypeCombobox name="sourceName" class="form-control bs-select"
                                [(ngModel)]="ordertech.techFileInfoType">
                                <option *ngFor="let Item of filetypes" [value]="Item.value">{{Item.displayText}}
                                </option>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label>部段号</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="paragraphNo" [ngClass]="{'edited': ordertech.paragraphNo}"
                                    [(ngModel)]="ordertech.paragraphNo">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label>图号</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="drawingCode" [ngClass]="{'edited': ordertech.drawingCode}"
                                    [(ngModel)]="ordertech.drawingCode" required>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label>图号名称</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="drawingName" [ngClass]="{'edited': ordertech.drawingName}"
                                    [(ngModel)]="ordertech.drawingName">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label>阶段</label>
                            <select #stageTypeCombobox name="sourceName" class="form-control bs-select"
                                [(ngModel)]="ordertech.stageType">
                                <option *ngFor="let Item of stages" [value]="Item.value">{{Item.displayText}}</option>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <label>页数</label>
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input class="form-control" name="pageCount" [ngClass]="{'edited': ordertech.pageCount}"
                                    [(ngModel)]="ordertech.pageCount">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label>密级</label>
                            <select #securityTypeCombobox name="sourceName" class="form-control bs-select"
                                [(ngModel)]="ordertech.securityType">
                                <option *ngFor="let Item of securitys" [value]="Item.value">{{Item.displayText}}
                                </option>
                            </select>
                        </div>
                        <!-- <div class="col-md-6">
                            <label>分发单位：</label>
                            {{ordertech.companyCodesStr}}
                            <select #selectedcodeCombobox name="sourceName" class="form-control bs-select"
                                [(ngModel)]="selectedcode">
                                <option *ngFor="let Item of companyCombobox" [value]="Item.value">{{Item.displayText}}
                                </option>
                            </select>
                        </div> -->
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <label>分发单位：</label>
                            {{ordertech.companyCodesStr}}
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-1" *ngFor="let Item of companyCombobox">
                            <button type="button" (click)="addCode(Item.value)" class="btn btn-primary btn-sm">
                                <i class="fa fa-plus"> </i>
                            </button>
                            {{Item.displayText}}
                            <br/>
                            <button type="button" (click)="delCode(Item.value)" class="btn btn-primary btn-sm">
                                <i class="fa fa-minus"> </i>
                            </button>
                        </div>
                    </div>
                    <div class="form-group form-md-line-input form-md-floating-label no-hint">
                        <label>备注</label>
                        <textarea class="form-control" type="text" name="remark" [ngClass]="{'edited': ordertech.remark}"
                            [(ngModel)]="ordertech.remark" rows="2"></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default"
                        (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!editForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>